Skip to content

[23기_김태희] spring tutorial 미션 제출합니다.#10

Open
gitaehee wants to merge 3 commits intoCEOS-Developers:gitaeheefrom
gitaehee:master
Open

[23기_김태희] spring tutorial 미션 제출합니다.#10
gitaehee wants to merge 3 commits intoCEOS-Developers:gitaeheefrom
gitaehee:master

Conversation

@gitaehee
Copy link

No description provided.

Copy link

@boogiewooki02 boogiewooki02 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

전체적으로 과제 수행 완성도가 굉장히 높으시네요! 고생 많으셨습니다. 👍👍

리드미에 스프링의 핵심 내용을 본인만의 표현으로 적어주신 부분이 아주 인상 깊었습니다.
다만, 실제 협업이나 실무 환경을 가정했을 때 더 완벽한 결과물을 위해 보안 설정(비밀번호 환경변수화)과 .gitignore 파일의 위치에 대해 몇 가지 작은 제안을 드렸습니다. 이 부분만 살짝 보완해 주시면 더욱 완벽한 과제가 될 것 같아요!

datasource:
url: jdbc:mysql://localhost:3306/test_db?allowPublicKeyRetrieval=true&useSSL=false&characterEncoding=UTF-8
username: root
password: 0812

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P1] DB 비밀번호 하드코딩 노출위험
현재 비밀번호가 직접 노출되어 있는 것 같습니다. 로컬에서 진행하는 과제이다보니 적어두신 것 같지만, 환경변수를 사용해서 비밀번호를 숨기는 방식으로 개선해봐도 좋을 것 같아요!

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P2] .gitignore 파일 위치 수정 제안
.gitignore 파일이 현재 /src 하위에 위치해 있는 것 같아요! 이 파일은 프로젝트 전체에 적용되어야 하기 때문에, .git 폴더가 있는 프로젝트 루트 경로로 옮겨주시면 좋을 것 같습니다.

Copy link

@taeik21 taeik21 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR 작성하시느라 고생 많으셨습니다! 직관적인 코드 예시 덕분에 확실하게 복습할 수 있었습니다.
아래에 DI 개념과 관련해서 코멘트 하나 남겼습니다.

Comment on lines +18 to +19
DI
- 빈을 스프링 컨테이너에 넣어주는 것
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

작성해주신 설명은 '빈 등록' 과정에 가까운 것 같습니다. DI는 스프링이 빈들을 서로 필요한 곳에 주입해주는 행위에 초점을 맞춰 생각해보시면 좋을 것 같습니다!

Comment on lines +103 to +113
1) 프로그램 시작 (SpringApplication.run)
2) ComponentScan 실행 (패키지 탐색)
3) 어노테이션 검사 (@Component, @Service 등 발견)
4) BeanDefinition 생성 (Bean 정보 저장)
5) 객체 생성 (Bean 인스턴스 생성)
6) 의존성 주입 (@Autowired)
7) 초기화 (@PostConstruct 실행)
8) 컨테이너에서 관리 (ApplicationContext가 Bean 관리)

<details>
<summary>코드 예시</summary>
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

컴포넌트 스캔부터 빈이 등록되는 것까지의 전체 흐름을 아래의 실제 코드로 정리해주셔 쉽게 이해할 수 있었습니다. 특히 DI, @PostConstruct, 빈 등록의 순서를 한 눈에 파악할 수 있었습니다. 좋은 정리 감사합니다!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants